﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Insteon
{
    public class LinkCode
    {
        public enum Codes
        {
            IMSlave = 0x00,
            IMMaster = 0x01,
            IMController = 0x03,
            ImDelete = 0xFF
        }

        public readonly Codes Value;

        internal LinkCode(byte Buffer)
        {
            switch (Buffer)
            {
                case (byte)Codes.IMSlave:
                    Value = Codes.IMSlave;
                    break;
                case (byte)Codes.IMMaster:
                    Value = Codes.IMMaster;
                    break;
                case (byte)Codes.IMController:
                    Value = Codes.IMController;
                    break;
                case (byte)Codes.ImDelete:
                    Value = Codes.ImDelete;
                    break;
            }
        }

        public override string ToString()
        {
            return String.Format("{0}", Value);
        }
    }
}
